<!--
 * @Author: your name
 * @Date: 2021-03-03 13:50:07
 * @LastEditTime: 2021-03-04 14:44:34
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vpvmf-web-vue\src\views\ftpManage\pricingManage\pricingTask\position_check.vue
-->
<template>
<!-- 选择头寸数据表界面 -->
  <div class="positionCheck">
    <el-form
      :model="searchForm"
      ref="searchRef"
      label-width="110px"
      label-position="left"
    >     
      <el-row>
        <el-col :span="10" :offset="1">
          <el-form-item label="后缀：" prop="pdPostFix" text-align="right">
            <el-input
              v-model="searchForm.pdPostFix"
              maxlength="32"
            ></el-input>
          </el-form-item>
        </el-col>
                <el-col :span="10" :offset="1">
          <el-form-item label="名称：" prop="pdName"     text-align="right">
            <el-input
              v-model="searchForm.pdName"
              maxlength="32"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
<el-row class="container">
      <el-col style="margin-right:10px;" class="content-left">
        <upper-template :searchIcon="false" :configIcon="false">
           <!-- 操作按钮区 -->
          <template slot="buttonArea" class="content-center">
            <el-button @click="query()">查询</el-button>
            <el-button @click="reset()">重置</el-button>
            <el-button @click="selectDataFunc()">确定</el-button>
          </template>
        </upper-template>
      </el-col>
      </el-row>
          <el-table
          ref="multipleModelTable"
          :data="tableModelData"
          style="width: 100%"
          @row-click="authorizeModelFor"
        >
        <el-table-column
            width="55"
            type="selection"
            
          ></el-table-column>
          <el-table-column
            prop="pdPostFix"
            label="后缀"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            prop="pdName"
            label="名称"
            :show-overflow-tooltip="true"
          ></el-table-column>
          </el-table>
          <!-- <pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="searchForm.page"
          :page-size="searchForm.size"
          @refresh="query"
          :total="total"
        ></pagination> -->
    </el-form>
  </div>
</template>

<script>
import { pricingTask } from "@/api/index";
export default {
  data() {
    return {
        //     //页面数据量
        //     total:'',
//列表数据
      tableModelData: [],
      searchForm:{
        pdPostFix:'',
        pdName:''
      },

    }
  },
  watch: {
  },
  components: {

  },
  created() {
    this.query();
  },
  computed: {
    
  },
  mounted() {

  },
  methods: {
      selectDataFunc() {
        let selection = this.$refs.multipleModelTable.selection;
      if (selection.length == 0) {
        return this.$message.warning("请选择一条数据");
      }
      let params = {
        row: selection,
        index: this.indexItems
      };
      console.log(params,"params");
      // 获取选中的数据
      this.$emit("selectDataFunc", params);
    },
    //查询表数据
    query(){
       pricingTask.findAllEnable(this.searchForm).then((res) => {
        if (res.code === 200) {
          this.tableModelData = res.datas;
        }
      });},
      reset(){
        this.searchForm={
                pdPostFix:'',
                pdName:''};

       },
//         handleSizeChange(val) {
//       this.searchForm.size = val;
//       this.searchFunc();
//       console.log(val, "每页数");
//     },
//     handleCurrentChange(val) {
//       this.searchForm.page = val;
//       this.searchFunc();
//       console.log(val, "当前页");
//     },
    //点击行选中
    authorizeModelFor(row) {
      if (this.$refs.multipleModelTable) {
          this.$refs.multipleModelTable.clearSelection()
      }
      this.$refs.multipleModelTable.toggleRowSelection(row, true)
    }
  }
};
</script>